/*
 * Created on Jul 16, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package com.herohead;

/**
 * @author david-1
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */

//import jcifs.Config;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileInputStream;

public class SmbLogin {

	public static void main(String[] args) {

		//jcifs.Config.setProperty("jcifs.netbios.wins", "192.168.1.220" );


		try {
			SmbFile sf = new SmbFile("smb://us01-gentran:gis.2.smt@bxd/deve/davidc/");
			//SmbFileInputStream in = new SmbFileInputStream("smb://us01-gentran:gis.2.smt@bxd/deve/davidc/sample.txt" );
			SmbFileInputStream in = new SmbFileInputStream("smb://us01-gentran:gis.2.smt@bxd/deve/davidc/sample.txt");

			String l[] = sf.list();

			System.out.println(l[1]);
			System.out.println(sf.getDiskFreeSpace());
			System.out.println(sf.getParent());
			System.out.println(sf.getPath());


			System.out.println(sf.canRead());

			if (sf.exists()) {
				System.out.println("file found");
			} else {
				System.out.println("Directory or share not found");
			}


			byte[] b = new byte[8192];
			int n;
			while(( n = in.read( b )) > 0 ) {
				System.out.write( b, 0, n );
			}
			in.close();



			//String l = new String(sf.list());

			//System.out.println(l);


		} catch (Exception e)
		{
		}
	}
}
